#include <iostream>
using namespace std;
int main()
{
	int arr[] = { 31,52,12,6,11,2,8,1,5,68,77,33,89 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	for (int i = 0; i < sz ; i++)
	{
		int min = i;
		for (int j = i + 1; j < sz; j++)
		{

			if (arr[min]>arr[j])
			{	
				min = j;
			}
		}
		if (min != i)
		{
			int tmp = arr[min];
			arr[min] = arr[i];
			arr[i] = tmp;
		}
	}
	for (int i = 0; i < sz; i++)
	{
		cout << arr[i] << "  ";
	}
}
